var json = {};
var a = [
    {
      time: '2018-06-21 19:15',
      amount: '0.08元'
    },
    {
      time: '2018-06-22 19:15',
      amount: '0.08元'
    },
    {
      time: '2017-06-23 19:15',
      amount: '0.08元'
    },
    {
      time: '2017-06-24 19:15',
      amount: '0.08元'
    },
    {
      time: '2017-07-25 19:15',
      amount: '0.08元'
    },
    {
      time: '2017-07-26 19:15',
      amount: '0.08元'
    },
  ];
function test(arr) {
    let json = {};
    for (let i=0;i<arr.length;i++){
        let date = new Date(arr[i].time);
        if ( !json[date.getFullYear()] ) {
            json[date.getFullYear()] = {};
        };
        if ( !json[date.getFullYear()][date.getMonth()]) {
            json[date.getFullYear()][date.getMonth()] = [];
        };
        json[date.getFullYear()][date.getMonth()].push(arr[i]);
    };      
    return json; 
};


function test1(arr) {
    let array = [];
    array.length = Number(new Date().getFullYear());

    for (let i=0;i<arr.length;i++){
        let date = new Date(arr[i].time);
        array[date.getFullYear()] = [];
        array[date.getFullYear()].length = 12;
        array[date.getFullYear()][date.getMonth()] = [];
        array[date.getFullYear()][date.getMonth()].push(arr[i]);
    }; 
    return array;
};
var b = test(a);
console.log(b);

<a class="num" v-bind:href="clickTradeRecords(1)">{{asset.rmb}}</a>


            clickTradeRecords: function (page) {
                return `http://pre-web.wallet.meitu.com/rwallet/user/index/#/tradeRecords?uid=${this.uid ? this.uid : 1561457746}&initialPage=${page}`;
            },

shouldComponentUpdate(nextProps, nextState) {
    // 拦截无效的render
    let isChangeProps = JSON.stringify(this.oldProps) !== JSON.stringify(nextProps);
    let isChangeState = JSON.stringify(this.state) !== JSON.stringify(nextState);
    if ( isChangeProps || isChangeState ) {
        // 无论是因为 props 改变还是 state 改变 都进行oldProps赋值
        this.oldProps = nextProps;
        return true;
    };
    return false;
};